<!--友情链接-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>个人中心</title>
    <link rel="stylesheet" href="../css/personal_center.css">
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/style_zj.css">
    <link rel="stylesheet" href="../layui/css/layui.css">
    <link rel="stylesheet" href="../fonts/iconfont.css">
    <!--<link rel="stylesheet" href="../less/laypage.css">-->
    <style>
        .active1{
            color: #fb6a30!important;
        }
    </style>
</head>
<body>
<!--<div id="header_01_html">
    <iframe id="header_01" src="head_01.html" frameborder="0"></iframe>
</div>-->
<div class="content-box">
    <!--<div id="left_tab_html">
        <iframe id="left_tab" src="left_tab.html?x=2&y=2" frameborder="0"></iframe>
    </div>-->
    <div class="right-box layui-form" id="vue-box" v-cloak>
        <div class="content-admin">
            <div class="title-toggle">
                <div class="item active">待报价</div>
                <div class="item">已报价</div>
            </div>
            <div>
                <div class="table-list">
                    <table>
                        <thead>
                        <tr>
                            <th>车型</th>
                            <th>配件清单</th>
                            <th class="js-allCheck">
                                图片
                            </th>

                            <th>询价时间</th>
                            <th>询价状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-for="(item,index) in pagList">
                            <td>{{item.commodityType}}</td>
                            <td>{{item.name}}</td>
                            <td class="js-onlyCheck p-r">
                                <img :src="imgBaseUrl + item.picUrl" alt="" class="img-sty"></td>
                            </td>
                            <td>{{item.price}}</td>
                            <td>待报价</td>
                            <td>
                                <div class="colo-blue cur-p">查看详情</div>
                                <div class="colo-blue cur-p">关闭报价</div>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div id="test1" class="text-r"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../js/config.js"></script>
<script>
    var postData = {
        limit:2,
        offset:1,
        type:'',
        name:'',
    }

    var app = new Vue({
        el: '#vue-box',
        data: {
            pagList:'',
            imgBaseUrl: imgBaseUrl,
            storeTypeList:[],
            active:null,
        },
        mounted:function(){
            var that = this;
            this.getPage();
            get_ajax("/sys/storeCommodityType/getStoreType", {storeId: localStorage.getItem('storeId')}, function (data) {
                var listArr = [];
                data.forEach(function(item){
                    item.subordinate.forEach(function(list){
                        listArr.push(list);
                    })
                })
                that.storeTypeList = listArr;
                console.log(that.storeTypeList);
            });

        },
        updated:function () {
            layui.use('form', function(){
                var form = layui.form;
                form.render("checkbox");
            });
        },
        methods:{
            getPage:function(){
                var that = this;
                get_ajaxPage("/quotation/geQuotationPage", postData, function (data) {
                    data.data.forEach(function (item) {
                        item.picUrl = item.picUrl.split(",")[0];
                    })
                    that.pagList = data.data;
                    layui.use('laypage', function(){
                        var laypage = layui.laypage;
                        //执行一个laypage实例
                        laypage.render({
                            elem: 'test1'
                            ,count: data.count //数据总数，从服务端得到
                            ,limit:postData.limit
                            ,jump: function(obj, first){
                                //obj包含了当前分页的所有参数，比如：
                                console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                                console.log(obj.limit); //得到每页显示的条数

                                //首次不执行
                                if(!first){
                                    //do something
                                    postData.offset = obj.curr;
                                    get_ajaxPage("/quotation/geQuotationPage", postData, function (data) {
                                        data.data.forEach(function (item) {
                                            item.picUrl = item.picUrl.split(",")[0];
                                        })
                                        that.pagList = data.data;
                                    })
                                }
                            }
                        });
                    });
                })



            },


        }
    });





















</script>
</body>
</html>
